package com.example.roomjavademo.dao;

import android.util.Log;

import androidx.lifecycle.LiveData;
import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;

import com.example.roomjavademo.entity.UserBean;

import java.util.ArrayList;
import java.util.List;

@Dao
public interface UserDao {
    @Query("SELECT * FROM user")
    LiveData<List<UserBean>> getAll();

    @Query("SELECT * FROM user where uid=:userId")
    LiveData<List<UserBean>> getUserById(int userId);

    @Insert
    Long[] insertUser(UserBean... var1);

    @Delete
    int deleteUser(UserBean... var1);

    @Query("delete from user")
    int deleteAll();

    @Update
    int updateUser(UserBean... var1);
}